/*
 * @Descripttion: 
 * @version: 
 * @Author: 侯勇
 * @Date: 2022-10-22 18:32:56
 * @LastEditors: 侯勇
 * @LastEditTime: 2022-10-28 22:11:35
 */
import React, { memo, useEffect } from 'react';
import { renderRoutes } from 'react-router-config';


import './index.css'
import { dicoverMenu } from '@/common/local-data'
import { NavLink } from 'react-router-dom';
import { HeaderWrapper } from './style.js'
//引入路由

//引入网络请求
import request from "@/services/request"

const HyDiscover = memo((props) => {


    // 发送网络请求:轮播图(compontDidmount)
    useEffect(() => {
        request({
            url: '/banner'
        }).then(res => {
            console.log('res', res)
        })
    }, [])

    const { route } = props;
    return (
        <HeaderWrapper>
            <div className='topNum'>
                <div className='wrap-v2 top-content'>
                    <div className='top-item'>
                        {
                            dicoverMenu.map((item, index) => {
                                return (

                                    <NavLink to={item.link} key={item.title}>
                                        {item.title}
                                    </NavLink>

                                )
                            })
                        }
                    </div>
                </div>
            </div>
            {renderRoutes(route.routes)}
        </HeaderWrapper>

    )
})

export default HyDiscover